<?php
header('Content-Type: application/json');

// 数据库连接配置
include 'config.php'; 


// 获取POST请求的JSON数据
$data = json_decode(file_get_contents('php://input'), true);

// 获取参数
$qq = $data['qq'];
$lxqq = $data['lxqq'];
$type = $data['type']; // 这里已经是时间戳

// 更新授权信息
$sql = "UPDATE sq SET lxqq = ?, vip_time = ? WHERE qq = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("sii", $lxqq, $type, $qq);

if ($stmt->execute()) {
    echo json_encode(['code' => 200, 'message' => '授权信息修改成功']);
} else {
    echo json_encode(['code' => 500, 'message' => '修改失败: ' . $stmt->error]);
}

$stmt->close();
$conn->close();
?>
